package com.ming.sportdemo.service.serviceImpl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ming.sportdemo.bean.Order;
import com.ming.sportdemo.dao.OrderDao;
import com.ming.sportdemo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements OrderService {

    @Autowired
    OrderDao orderDao;

    @Override
    public int getOrderCounts(String userId) {
        return orderDao.getOrderCounts(userId);
    }

    @Override
    public List<Order> getAllOrder(String userId, int pageStart, int pageSize) {
        return orderDao.getAllOrder(userId,pageStart,pageSize);
    }

    @Override
    public int addOrder(Order order) {
        return orderDao.addOrder(order);
    }

    @Override
    public int deleteOrder(int orderId) {
            return orderDao.deleteOrder(orderId);
    }

    @Override
    public int updateOrder(Order order) {
        return orderDao.updateOrder(order);
    }


    @Override
    public int updateOrderStates(Integer orderId, Boolean orderState) {
        return orderDao.updateOrderStates(orderId,orderState);
    }

    @Override
    public int updateOrderState(int orderId) {
        return orderDao.updateOrderState(orderId);
    }


}
